/*
 * @Author: llixxm
 * @Date: 2021-08-23 09:40:03
 * @Description: 月结检查报告小部件表格
 */
import React, { Component } from 'react';

import { base } from 'nc-lightapp-front';
const { NCProgressBar } = base;
import './index.less';

export default class ProgressTable extends Component {
	constructor(props) {
		super(props);
		this.state={
			
		}
	}
    
	componentWillMount() {}

	render() {
        let { json, data } = this.props;
		return (
			<div className="progress-table nc-theme-area-bgc  nc-theme-Widgets-font-c">
				<table border="1">
					<thead className="nc-theme-Widgets-bgc">
						<tr>
							<th className="col-width-68">{json['2002REPORTCOMSINGLE-000002']}</th>{/* 国际化处理： 会计期间*/}
							<th className="col-width-200">{json['2002REPORTCOMSINGLE-000003']}/{json['2002REPORTCOMSINGLE-000004']}</th>{/* 国际化处理： 财务核算账簿编码,名称*/}
							<th className="col-width-68">{json['2002REPORTCOMSINGLE-000005']}</th>{/* 国际化处理： 进度*/}
							<th className="col-width-68">{json['2002REPORTCOMSINGLE-000006']}</th>{/* 国际化处理： 状态*/}
						</tr>
					</thead>
					<tbody>
						{
							data.map((item) => {
								if (item.key % 2 !== 0) {
									let processvalue = parseFloat(item.processvalue);
									return (
										<tr className="tr-progress">
											<td colspan="4">
												<NCProgressBar colors={processvalue === 100 ? 'primary' : 'danger'} now={processvalue}></NCProgressBar>
											</td>
										</tr>
									)
								} else {
									return (
										<tr className='tr-content'>
											<td className="pt-12">{item.period}</td>
											<td className="pt-12">
												<span className='accounting'>{item.accountingbookcode}</span>
												<span className="accounting accounting-name">{item.accountingbookname}</span>
											</td>
											<td className="pt-12 font-14 nc-theme-title-font-c">{item.processvalue}</td>
											<td className={item.issettled === 'N' ? 'pt-12 se-info' : 'pt-12 se-success'}>
											{
												//item.issettled === 'N' ? '未结账' : '已结账'
												item.issettled === 'Z' ? "" :  item.issettled === 'N' ? json['2002REPORTCOMSINGLE-000000'] : json['2002REPORTCOMSINGLE-000001']/* 国际化处理： 未结账,已结账*/
											}
											</td>
										</tr>
									)
								}
							})
						}
					</tbody>
				</table>
			</div>
		);
	}
}

